<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>stm32f4_blink_led: D:/123/stm32f4_blink_led-1.2.2-120323/inc/core_cmFunc.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">stm32f4_blink_led
   &#160;<span id="projectnumber">1.2.2-120323</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">D:/123/stm32f4_blink_led-1.2.2-120323/inc/core_cmFunc.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="core__cm_func_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**************************************************************************/</span>
<a name="l00024"></a>00024 <span class="preprocessor">#ifndef __CORE_CMFUNC_H</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define __CORE_CMFUNC_H</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="comment">/* ###########################  Core Function Access  ########################### */</span>
<a name="l00034"></a>00034 <span class="preprocessor">#if   defined ( __CC_ARM ) </span><span class="comment">/*------------------RealView Compiler -----------------*/</span>
<a name="l00035"></a>00035 <span class="comment">/* ARM armcc specific functions */</span>
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="preprocessor">#if (__ARMCC_VERSION &lt; 400677)</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">  #error &quot;Please use ARM Compiler Toolchain V4.0.677 or later!&quot;</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="comment">/* intrinsic void __enable_irq();     */</span>
<a name="l00042"></a>00042 <span class="comment">/* intrinsic void __disable_irq();    */</span>
<a name="l00043"></a>00043 
<a name="l00050"></a>00050 <span class="keyword">static</span> __INLINE uint32_t __get_CONTROL(<span class="keywordtype">void</span>)
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052   <span class="keyword">register</span> uint32_t __regControl         __ASM(<span class="stringliteral">&quot;control&quot;</span>);
<a name="l00053"></a>00053   <span class="keywordflow">return</span>(__regControl);
<a name="l00054"></a>00054 }
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 
<a name="l00063"></a>00063 <span class="keyword">static</span> __INLINE <span class="keywordtype">void</span> __set_CONTROL(uint32_t control)
<a name="l00064"></a>00064 {
<a name="l00065"></a>00065   <span class="keyword">register</span> uint32_t __regControl         __ASM(<span class="stringliteral">&quot;control&quot;</span>);
<a name="l00066"></a>00066   __regControl = control;
<a name="l00067"></a>00067 }
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 
<a name="l00076"></a>00076 <span class="keyword">static</span> __INLINE uint32_t __get_IPSR(<span class="keywordtype">void</span>)
<a name="l00077"></a>00077 {
<a name="l00078"></a>00078   <span class="keyword">register</span> uint32_t __regIPSR          __ASM(<span class="stringliteral">&quot;ipsr&quot;</span>);
<a name="l00079"></a>00079   <span class="keywordflow">return</span>(__regIPSR);
<a name="l00080"></a>00080 }
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 
<a name="l00089"></a>00089 <span class="keyword">static</span> __INLINE uint32_t __get_APSR(<span class="keywordtype">void</span>)
<a name="l00090"></a>00090 {
<a name="l00091"></a>00091   <span class="keyword">register</span> uint32_t __regAPSR          __ASM(<span class="stringliteral">&quot;apsr&quot;</span>);
<a name="l00092"></a>00092   <span class="keywordflow">return</span>(__regAPSR);
<a name="l00093"></a>00093 }
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 
<a name="l00102"></a>00102 <span class="keyword">static</span> __INLINE uint32_t __get_xPSR(<span class="keywordtype">void</span>)
<a name="l00103"></a>00103 {
<a name="l00104"></a>00104   <span class="keyword">register</span> uint32_t __regXPSR          __ASM(<span class="stringliteral">&quot;xpsr&quot;</span>);
<a name="l00105"></a>00105   <span class="keywordflow">return</span>(__regXPSR);
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107 
<a name="l00108"></a>00108 
<a name="l00115"></a>00115 <span class="keyword">static</span> __INLINE uint32_t __get_PSP(<span class="keywordtype">void</span>)
<a name="l00116"></a>00116 {
<a name="l00117"></a>00117   <span class="keyword">register</span> uint32_t __regProcessStackPointer  __ASM(<span class="stringliteral">&quot;psp&quot;</span>);
<a name="l00118"></a>00118   <span class="keywordflow">return</span>(__regProcessStackPointer);
<a name="l00119"></a>00119 }
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 
<a name="l00128"></a>00128 <span class="keyword">static</span> __INLINE <span class="keywordtype">void</span> __set_PSP(uint32_t topOfProcStack)
<a name="l00129"></a>00129 {
<a name="l00130"></a>00130   <span class="keyword">register</span> uint32_t __regProcessStackPointer  __ASM(<span class="stringliteral">&quot;psp&quot;</span>);
<a name="l00131"></a>00131   __regProcessStackPointer = topOfProcStack;
<a name="l00132"></a>00132 }
<a name="l00133"></a>00133 
<a name="l00134"></a>00134 
<a name="l00141"></a>00141 <span class="keyword">static</span> __INLINE uint32_t __get_MSP(<span class="keywordtype">void</span>)
<a name="l00142"></a>00142 {
<a name="l00143"></a>00143   <span class="keyword">register</span> uint32_t __regMainStackPointer     __ASM(<span class="stringliteral">&quot;msp&quot;</span>);
<a name="l00144"></a>00144   <span class="keywordflow">return</span>(__regMainStackPointer);
<a name="l00145"></a>00145 }
<a name="l00146"></a>00146 
<a name="l00147"></a>00147 
<a name="l00154"></a>00154 <span class="keyword">static</span> __INLINE <span class="keywordtype">void</span> __set_MSP(uint32_t topOfMainStack)
<a name="l00155"></a>00155 {
<a name="l00156"></a>00156   <span class="keyword">register</span> uint32_t __regMainStackPointer     __ASM(<span class="stringliteral">&quot;msp&quot;</span>);
<a name="l00157"></a>00157   __regMainStackPointer = topOfMainStack;
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159 
<a name="l00160"></a>00160 
<a name="l00167"></a>00167 <span class="keyword">static</span> __INLINE uint32_t __get_PRIMASK(<span class="keywordtype">void</span>)
<a name="l00168"></a>00168 {
<a name="l00169"></a>00169   <span class="keyword">register</span> uint32_t __regPriMask         __ASM(<span class="stringliteral">&quot;primask&quot;</span>);
<a name="l00170"></a>00170   <span class="keywordflow">return</span>(__regPriMask);
<a name="l00171"></a>00171 }
<a name="l00172"></a>00172 
<a name="l00173"></a>00173 
<a name="l00180"></a>00180 <span class="keyword">static</span> __INLINE <span class="keywordtype">void</span> __set_PRIMASK(uint32_t priMask)
<a name="l00181"></a>00181 {
<a name="l00182"></a>00182   <span class="keyword">register</span> uint32_t __regPriMask         __ASM(<span class="stringliteral">&quot;primask&quot;</span>);
<a name="l00183"></a>00183   __regPriMask = (priMask);
<a name="l00184"></a>00184 }
<a name="l00185"></a>00185  
<a name="l00186"></a>00186 
<a name="l00187"></a>00187 <span class="preprocessor">#if       (__CORTEX_M &gt;= 0x03)</span>
<a name="l00188"></a>00188 <span class="preprocessor"></span>
<a name="l00194"></a>00194 <span class="preprocessor">#define __enable_fault_irq                __enable_fiq</span>
<a name="l00195"></a>00195 <span class="preprocessor"></span>
<a name="l00196"></a>00196 
<a name="l00202"></a>00202 <span class="preprocessor">#define __disable_fault_irq               __disable_fiq</span>
<a name="l00203"></a>00203 <span class="preprocessor"></span>
<a name="l00204"></a>00204 
<a name="l00211"></a>00211 <span class="keyword">static</span> __INLINE uint32_t  __get_BASEPRI(<span class="keywordtype">void</span>)
<a name="l00212"></a>00212 {
<a name="l00213"></a>00213   <span class="keyword">register</span> uint32_t __regBasePri         __ASM(<span class="stringliteral">&quot;basepri&quot;</span>);
<a name="l00214"></a>00214   <span class="keywordflow">return</span>(__regBasePri);
<a name="l00215"></a>00215 }
<a name="l00216"></a>00216 
<a name="l00217"></a>00217 
<a name="l00224"></a>00224 <span class="keyword">static</span> __INLINE <span class="keywordtype">void</span> __set_BASEPRI(uint32_t basePri)
<a name="l00225"></a>00225 {
<a name="l00226"></a>00226   <span class="keyword">register</span> uint32_t __regBasePri         __ASM(<span class="stringliteral">&quot;basepri&quot;</span>);
<a name="l00227"></a>00227   __regBasePri = (basePri &amp; 0xff);
<a name="l00228"></a>00228 }
<a name="l00229"></a>00229  
<a name="l00230"></a>00230 
<a name="l00237"></a>00237 <span class="keyword">static</span> __INLINE uint32_t __get_FAULTMASK(<span class="keywordtype">void</span>)
<a name="l00238"></a>00238 {
<a name="l00239"></a>00239   <span class="keyword">register</span> uint32_t __regFaultMask       __ASM(<span class="stringliteral">&quot;faultmask&quot;</span>);
<a name="l00240"></a>00240   <span class="keywordflow">return</span>(__regFaultMask);
<a name="l00241"></a>00241 }
<a name="l00242"></a>00242 
<a name="l00243"></a>00243 
<a name="l00250"></a>00250 <span class="keyword">static</span> __INLINE <span class="keywordtype">void</span> __set_FAULTMASK(uint32_t faultMask)
<a name="l00251"></a>00251 {
<a name="l00252"></a>00252   <span class="keyword">register</span> uint32_t __regFaultMask       __ASM(<span class="stringliteral">&quot;faultmask&quot;</span>);
<a name="l00253"></a>00253   __regFaultMask = (faultMask &amp; (uint32_t)1);
<a name="l00254"></a>00254 }
<a name="l00255"></a>00255 
<a name="l00256"></a>00256 <span class="preprocessor">#endif </span><span class="comment">/* (__CORTEX_M &gt;= 0x03) */</span>
<a name="l00257"></a>00257 
<a name="l00258"></a>00258 
<a name="l00259"></a>00259 <span class="preprocessor">#if       (__CORTEX_M == 0x04)</span>
<a name="l00260"></a>00260 <span class="preprocessor"></span>
<a name="l00267"></a>00267 <span class="keyword">static</span> __INLINE uint32_t __get_FPSCR(<span class="keywordtype">void</span>)
<a name="l00268"></a>00268 {
<a name="l00269"></a>00269 <span class="preprocessor">#if (__FPU_PRESENT == 1) &amp;&amp; (__FPU_USED == 1)</span>
<a name="l00270"></a>00270 <span class="preprocessor"></span>  <span class="keyword">register</span> uint32_t __regfpscr         __ASM(<span class="stringliteral">&quot;fpscr&quot;</span>);
<a name="l00271"></a>00271   <span class="keywordflow">return</span>(__regfpscr);
<a name="l00272"></a>00272 <span class="preprocessor">#else</span>
<a name="l00273"></a>00273 <span class="preprocessor"></span>   <span class="keywordflow">return</span>(0);
<a name="l00274"></a>00274 <span class="preprocessor">#endif</span>
<a name="l00275"></a>00275 <span class="preprocessor"></span>}
<a name="l00276"></a>00276 
<a name="l00277"></a>00277 
<a name="l00284"></a>00284 <span class="keyword">static</span> __INLINE <span class="keywordtype">void</span> __set_FPSCR(uint32_t fpscr)
<a name="l00285"></a>00285 {
<a name="l00286"></a>00286 <span class="preprocessor">#if (__FPU_PRESENT == 1) &amp;&amp; (__FPU_USED == 1)</span>
<a name="l00287"></a>00287 <span class="preprocessor"></span>  <span class="keyword">register</span> uint32_t __regfpscr         __ASM(<span class="stringliteral">&quot;fpscr&quot;</span>);
<a name="l00288"></a>00288   __regfpscr = (fpscr);
<a name="l00289"></a>00289 <span class="preprocessor">#endif</span>
<a name="l00290"></a>00290 <span class="preprocessor"></span>}
<a name="l00291"></a>00291 
<a name="l00292"></a>00292 <span class="preprocessor">#endif </span><span class="comment">/* (__CORTEX_M == 0x04) */</span>
<a name="l00293"></a>00293 
<a name="l00294"></a>00294 
<a name="l00295"></a>00295 <span class="preprocessor">#elif defined ( __ICCARM__ ) </span><span class="comment">/*------------------ ICC Compiler -------------------*/</span>
<a name="l00296"></a>00296 <span class="comment">/* IAR iccarm specific functions */</span>
<a name="l00297"></a>00297 
<a name="l00298"></a>00298 <span class="preprocessor">#include &lt;cmsis_iar.h&gt;</span>
<a name="l00299"></a>00299 
<a name="l00300"></a>00300 <span class="preprocessor">#elif defined ( __GNUC__ ) </span><span class="comment">/*------------------ GNU Compiler ---------------------*/</span>
<a name="l00301"></a>00301 <span class="comment">/* GNU gcc specific functions */</span>
<a name="l00302"></a>00302 
<a name="l00308"></a>00308 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __enable_irq(<span class="keywordtype">void</span>)
<a name="l00309"></a>00309 {
<a name="l00310"></a>00310   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;cpsie i&quot;</span>);
<a name="l00311"></a>00311 }
<a name="l00312"></a>00312 
<a name="l00313"></a>00313 
<a name="l00319"></a>00319 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __disable_irq(<span class="keywordtype">void</span>)
<a name="l00320"></a>00320 {
<a name="l00321"></a>00321   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;cpsid i&quot;</span>);
<a name="l00322"></a>00322 }
<a name="l00323"></a>00323 
<a name="l00324"></a>00324 
<a name="l00331"></a>00331 __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_CONTROL(<span class="keywordtype">void</span>)
<a name="l00332"></a>00332 {
<a name="l00333"></a>00333   uint32_t result;
<a name="l00334"></a>00334 
<a name="l00335"></a>00335   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MRS %0, control&quot;</span> : <span class="stringliteral">&quot;=r&quot;</span> (result) );
<a name="l00336"></a>00336   <span class="keywordflow">return</span>(result);
<a name="l00337"></a>00337 }
<a name="l00338"></a>00338 
<a name="l00339"></a>00339 
<a name="l00346"></a>00346 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __set_CONTROL(uint32_t control)
<a name="l00347"></a>00347 {
<a name="l00348"></a>00348   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MSR control, %0&quot;</span> : : <span class="stringliteral">&quot;r&quot;</span> (control) );
<a name="l00349"></a>00349 }
<a name="l00350"></a>00350 
<a name="l00351"></a>00351 
<a name="l00358"></a>00358 __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_IPSR(<span class="keywordtype">void</span>)
<a name="l00359"></a>00359 {
<a name="l00360"></a>00360   uint32_t result;
<a name="l00361"></a>00361 
<a name="l00362"></a>00362   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MRS %0, ipsr&quot;</span> : <span class="stringliteral">&quot;=r&quot;</span> (result) );
<a name="l00363"></a>00363   <span class="keywordflow">return</span>(result);
<a name="l00364"></a>00364 }
<a name="l00365"></a>00365 
<a name="l00366"></a>00366 
<a name="l00373"></a>00373 __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_APSR(<span class="keywordtype">void</span>)
<a name="l00374"></a>00374 {
<a name="l00375"></a>00375   uint32_t result;
<a name="l00376"></a>00376 
<a name="l00377"></a>00377   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MRS %0, apsr&quot;</span> : <span class="stringliteral">&quot;=r&quot;</span> (result) );
<a name="l00378"></a>00378   <span class="keywordflow">return</span>(result);
<a name="l00379"></a>00379 }
<a name="l00380"></a>00380 
<a name="l00381"></a>00381 
<a name="l00388"></a>00388 __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_xPSR(<span class="keywordtype">void</span>)
<a name="l00389"></a>00389 {
<a name="l00390"></a>00390   uint32_t result;
<a name="l00391"></a>00391 
<a name="l00392"></a>00392   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MRS %0, xpsr&quot;</span> : <span class="stringliteral">&quot;=r&quot;</span> (result) );
<a name="l00393"></a>00393   <span class="keywordflow">return</span>(result);
<a name="l00394"></a>00394 }
<a name="l00395"></a>00395 
<a name="l00396"></a>00396 
<a name="l00403"></a>00403 __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_PSP(<span class="keywordtype">void</span>)
<a name="l00404"></a>00404 {
<a name="l00405"></a>00405   <span class="keyword">register</span> uint32_t result;
<a name="l00406"></a>00406 
<a name="l00407"></a>00407   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MRS %0, psp\n&quot;</span>  : <span class="stringliteral">&quot;=r&quot;</span> (result) );
<a name="l00408"></a>00408   <span class="keywordflow">return</span>(result);
<a name="l00409"></a>00409 }
<a name="l00410"></a>00410  
<a name="l00411"></a>00411 
<a name="l00418"></a>00418 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __set_PSP(uint32_t topOfProcStack)
<a name="l00419"></a>00419 {
<a name="l00420"></a>00420   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MSR psp, %0\n&quot;</span> : : <span class="stringliteral">&quot;r&quot;</span> (topOfProcStack) );
<a name="l00421"></a>00421 }
<a name="l00422"></a>00422 
<a name="l00423"></a>00423 
<a name="l00430"></a>00430 __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_MSP(<span class="keywordtype">void</span>)
<a name="l00431"></a>00431 {
<a name="l00432"></a>00432   <span class="keyword">register</span> uint32_t result;
<a name="l00433"></a>00433 
<a name="l00434"></a>00434   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MRS %0, msp\n&quot;</span> : <span class="stringliteral">&quot;=r&quot;</span> (result) );
<a name="l00435"></a>00435   <span class="keywordflow">return</span>(result);
<a name="l00436"></a>00436 }
<a name="l00437"></a>00437  
<a name="l00438"></a>00438 
<a name="l00445"></a>00445 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __set_MSP(uint32_t topOfMainStack)
<a name="l00446"></a>00446 {
<a name="l00447"></a>00447   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MSR msp, %0\n&quot;</span> : : <span class="stringliteral">&quot;r&quot;</span> (topOfMainStack) );
<a name="l00448"></a>00448 }
<a name="l00449"></a>00449 
<a name="l00450"></a>00450 
<a name="l00457"></a>00457 __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_PRIMASK(<span class="keywordtype">void</span>)
<a name="l00458"></a>00458 {
<a name="l00459"></a>00459   uint32_t result;
<a name="l00460"></a>00460 
<a name="l00461"></a>00461   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MRS %0, primask&quot;</span> : <span class="stringliteral">&quot;=r&quot;</span> (result) );
<a name="l00462"></a>00462   <span class="keywordflow">return</span>(result);
<a name="l00463"></a>00463 }
<a name="l00464"></a>00464 
<a name="l00465"></a>00465 
<a name="l00472"></a>00472 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __set_PRIMASK(uint32_t priMask)
<a name="l00473"></a>00473 {
<a name="l00474"></a>00474   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MSR primask, %0&quot;</span> : : <span class="stringliteral">&quot;r&quot;</span> (priMask) );
<a name="l00475"></a>00475 }
<a name="l00476"></a>00476  
<a name="l00477"></a>00477 
<a name="l00478"></a>00478 <span class="preprocessor">#if       (__CORTEX_M &gt;= 0x03)</span>
<a name="l00479"></a>00479 <span class="preprocessor"></span>
<a name="l00485"></a>00485 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __enable_fault_irq(<span class="keywordtype">void</span>)
<a name="l00486"></a>00486 {
<a name="l00487"></a>00487   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;cpsie f&quot;</span>);
<a name="l00488"></a>00488 }
<a name="l00489"></a>00489 
<a name="l00490"></a>00490 
<a name="l00496"></a>00496 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __disable_fault_irq(<span class="keywordtype">void</span>)
<a name="l00497"></a>00497 {
<a name="l00498"></a>00498   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;cpsid f&quot;</span>);
<a name="l00499"></a>00499 }
<a name="l00500"></a>00500 
<a name="l00501"></a>00501 
<a name="l00508"></a>00508 __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_BASEPRI(<span class="keywordtype">void</span>)
<a name="l00509"></a>00509 {
<a name="l00510"></a>00510   uint32_t result;
<a name="l00511"></a>00511   
<a name="l00512"></a>00512   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MRS %0, basepri_max&quot;</span> : <span class="stringliteral">&quot;=r&quot;</span> (result) );
<a name="l00513"></a>00513   <span class="keywordflow">return</span>(result);
<a name="l00514"></a>00514 }
<a name="l00515"></a>00515 
<a name="l00516"></a>00516 
<a name="l00523"></a>00523 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __set_BASEPRI(uint32_t value)
<a name="l00524"></a>00524 {
<a name="l00525"></a>00525   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MSR basepri, %0&quot;</span> : : <span class="stringliteral">&quot;r&quot;</span> (value) );
<a name="l00526"></a>00526 }
<a name="l00527"></a>00527 
<a name="l00528"></a>00528 
<a name="l00535"></a>00535 __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_FAULTMASK(<span class="keywordtype">void</span>)
<a name="l00536"></a>00536 {
<a name="l00537"></a>00537   uint32_t result;
<a name="l00538"></a>00538   
<a name="l00539"></a>00539   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MRS %0, faultmask&quot;</span> : <span class="stringliteral">&quot;=r&quot;</span> (result) );
<a name="l00540"></a>00540   <span class="keywordflow">return</span>(result);
<a name="l00541"></a>00541 }
<a name="l00542"></a>00542 
<a name="l00543"></a>00543 
<a name="l00550"></a>00550 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __set_FAULTMASK(uint32_t faultMask)
<a name="l00551"></a>00551 {
<a name="l00552"></a>00552   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;MSR faultmask, %0&quot;</span> : : <span class="stringliteral">&quot;r&quot;</span> (faultMask) );
<a name="l00553"></a>00553 }
<a name="l00554"></a>00554 
<a name="l00555"></a>00555 <span class="preprocessor">#endif </span><span class="comment">/* (__CORTEX_M &gt;= 0x03) */</span>
<a name="l00556"></a>00556 
<a name="l00557"></a>00557 
<a name="l00558"></a>00558 <span class="preprocessor">#if       (__CORTEX_M == 0x04)</span>
<a name="l00559"></a>00559 <span class="preprocessor"></span>
<a name="l00566"></a>00566 __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_FPSCR(<span class="keywordtype">void</span>)
<a name="l00567"></a>00567 {
<a name="l00568"></a>00568 <span class="preprocessor">#if (__FPU_PRESENT == 1) &amp;&amp; (__FPU_USED == 1)</span>
<a name="l00569"></a>00569 <span class="preprocessor"></span>  uint32_t result;
<a name="l00570"></a>00570 
<a name="l00571"></a>00571   __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;VMRS %0, fpscr&quot;</span> : <span class="stringliteral">&quot;=r&quot;</span> (result) );
<a name="l00572"></a>00572   <span class="keywordflow">return</span>(result);
<a name="l00573"></a>00573 <span class="preprocessor">#else</span>
<a name="l00574"></a>00574 <span class="preprocessor"></span>   <span class="keywordflow">return</span>(0);
<a name="l00575"></a>00575 <span class="preprocessor">#endif</span>
<a name="l00576"></a>00576 <span class="preprocessor"></span>}
<a name="l00577"></a>00577 
<a name="l00578"></a>00578 
<a name="l00585"></a>00585 __attribute__( ( always_inline ) ) static __INLINE <span class="keywordtype">void</span> __set_FPSCR(uint32_t fpscr)
<a name="l00586"></a>00586 {
<a name="l00587"></a>00587 <span class="preprocessor">#if (__FPU_PRESENT == 1) &amp;&amp; (__FPU_USED == 1)</span>
<a name="l00588"></a>00588 <span class="preprocessor"></span>  __ASM <span class="keyword">volatile</span> (<span class="stringliteral">&quot;VMSR fpscr, %0&quot;</span> : : <span class="stringliteral">&quot;r&quot;</span> (fpscr) );
<a name="l00589"></a>00589 <span class="preprocessor">#endif</span>
<a name="l00590"></a>00590 <span class="preprocessor"></span>}
<a name="l00591"></a>00591 
<a name="l00592"></a>00592 <span class="preprocessor">#endif </span><span class="comment">/* (__CORTEX_M == 0x04) */</span>
<a name="l00593"></a>00593 
<a name="l00594"></a>00594 
<a name="l00595"></a>00595 <span class="preprocessor">#elif defined ( __TASKING__ ) </span><span class="comment">/*------------------ TASKING Compiler --------------*/</span>
<a name="l00596"></a>00596 <span class="comment">/* TASKING carm specific functions */</span>
<a name="l00597"></a>00597 
<a name="l00598"></a>00598 <span class="comment">/*</span>
<a name="l00599"></a>00599 <span class="comment"> * The CMSIS functions have been implemented as intrinsics in the compiler.</span>
<a name="l00600"></a>00600 <span class="comment"> * Please use &quot;carm -?i&quot; to get an up to date list of all instrinsics,</span>
<a name="l00601"></a>00601 <span class="comment"> * Including the CMSIS ones.</span>
<a name="l00602"></a>00602 <span class="comment"> */</span>
<a name="l00603"></a>00603 
<a name="l00604"></a>00604 <span class="preprocessor">#endif</span>
<a name="l00605"></a>00605 <span class="preprocessor"></span>
<a name="l00609"></a>00609 <span class="preprocessor">#endif </span><span class="comment">/* __CORE_CMFUNC_H */</span>
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 23 2012 00:11:20 for stm32f4_blink_led by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
